Optimal. Leaf size=62 \[ b \left (3 a^2-b^2\right ) x-\frac {3 a b^2 \log (\cos (c+d x))}{d}+\frac {a^3 \log (\sin (c+d x))}{d}+\frac {b^2 (a+b \tan (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3647, 3705,
3556} \begin {gather*} \frac {a^3 \log (\sin (c+d x))}{d}+b x \left (3 a^2-b^2\right )+\frac {b^2 (a+b \tan (c+d x))}{d}-\frac {3 a b^2 \log (\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3647
Rule 3705
Rubi steps
\begin {align*} \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx &=\frac {b^2 (a+b \tan (c+d x))}{d}+\int \cot (c+d x) \left (a^3+b \left (3 a^2-b^2\right ) \tan (c+d x)+3 a b^2 \tan ^2(c+d x)\right ) \, dx\\ &=b \left (3 a^2-b^2\right ) x+\frac {b^2 (a+b \tan (c+d x))}{d}+a^3 \int \cot (c+d x) \, dx+\left (3 a b^2\right ) \int \tan (c+d x) \, dx\\ &=b \left (3 a^2-b^2\right ) x-\frac {3 a b^2 \log (\cos (c+d x))}{d}+\frac {a^3 \log (\sin (c+d x))}{d}+\frac {b^2 (a+b \tan (c+d x))}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.21, size = 79, normalized size = 1.27 \begin {gather*} -\frac {(a+i b)^3 \log (i-\tan (c+d x))-2 a^3 \log (\tan (c+d x))+(a-i b)^3 \log (i+\tan (c+d x))-2 b^2 (a+b \tan (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 59, normalized size = 0.95
method | result | size |
derivativedivides | \(\frac {a^{3} \ln \left (\sin \left (d x +c \right )\right )+3 a^{2} b \left (d x +c \right )-3 b^{2} a \ln \left (\cos \left (d x +c \right )\right )+b^{3} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(59\) |
default | \(\frac {a^{3} \ln \left (\sin \left (d x +c \right )\right )+3 a^{2} b \left (d x +c \right )-3 b^{2} a \ln \left (\cos \left (d x +c \right )\right )+b^{3} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(59\) |
norman | \(\left (3 a^{2} b -b^{3}\right ) x +\frac {b^{3} \tan \left (d x +c \right )}{d}+\frac {a^{3} \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {a \left (a^{2}-3 b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(69\) |
risch | \(3 a^{2} b x -b^{3} x -i a^{3} x +3 i a \,b^{2} x +\frac {6 i a \,b^{2} c}{d}-\frac {2 i a^{3} c}{d}+\frac {2 i b^{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {3 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) b^{2}}{d}+\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(113\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 71, normalized size = 1.15 \begin {gather*} \frac {2 \, a^{3} \log \left (\tan \left (d x + c\right )\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} - {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.29, size = 78, normalized size = 1.26 \begin {gather*} \frac {a^{3} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - 3 \, a b^{2} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} d x}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.32, size = 92, normalized size = 1.48 \begin {gather*} \begin {cases} - \frac {a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + 3 a^{2} b x + \frac {3 a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - b^{3} x + \frac {b^{3} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{3} \cot {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.01, size = 72, normalized size = 1.16 \begin {gather*} \frac {2 \, a^{3} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} - {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.86, size = 75, normalized size = 1.21 \begin {gather*} \frac {b^3\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,{\left (a+b\,1{}\mathrm {i}\right )}^3}{2\,d}+\frac {a^3\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________